<template>
  <form>
    <label>切换语言: </label>
    <select v-model="locale">
      <option value="en">en</option>
      <option value="zh">zh</option>
    </select>
  </form>
  <p>{{ t('hello') }}</p>
  <p>{{ t('待提取的文本') }}</p>
</template>

<script setup>
import {useI18n} from 'vue-i18n'

const {t, locale} = useI18n() // 直接从useI18n解构locale

</script>
